What is wrong with this implementation of merge sort